made all class definitions consistent

put private function definitions and class variables at end of class