implemented movement functionality