Added shifting code (Definitely needs testing)