added method for finding appropriate shift positions
called method in move(.)