mars rover in javascript. Forward and backward movements