Implemented first part of question
reimplementation of side-determining algorithm. Still needs comments and needs to be cleaned
Added comments and cleaned up some
Deleted old code
Started implementing second part of 1.2