#23 Move _resolveCollisions to the end of the file where we keep private functions
#23 Refactoring code and adding more docs to the new methods.