fixed calling methods too often and formatted update variable in main