added sampling a movement code.