fix shift function passing and the tests