Fixed + simplified collision
Added comments and improved organization