Put each { on a new line.
I have done so now.
void setup(){
void loop(){
if(time - preTime > potInterval){
Your idea of putting each { on a new line and mine must be different, then.
Use Tools + Auto format to fix the indenting.
You don't even have a match number of open and close curly braces. I KNOW that Tools + Auto Format told you that.