Cleaned up collision algorithm