implemented end turn functionality