Implementation of  subroutine: the step of the snake