added working solution for rotating matrix in place