fixed collision

... and some structural improvements