Added movepiece function