made more generic shift functions with bool value rather than separate functions