modify generalized version of side move but does not work :( lol will fix later