Arduino Nano V3 only runs sketch correctly after hitting reset or starting serial monitor

Oh wait!!! Do you think the sensors work, but some other function doesnt? Maybe the sqr formula?