adds collision manager, cleans up code