Adding new macro for calculating shifts