Added code for shift functions.