Fixed bugs
Added helper methods
Added comments