added collision detection code
Merge pull request #3 from coreyor/master

added collision detection code