Better boundary collision check.
Merge pull request #1 from dparpyani/master

Better boundary collision check.