Added helper functions to calculate positions
Made helper methods class methods