Added spatial hash for collisions

A bit hacky, but it works.