fixed crazy movement layer bug, as well as allowing for loops of length 1