matrix transformations and collisions implemented