replacing transform function with one that will work
changing logics from matrices to transformations