Actually handle collisions properly
Add debugging flag to globals