added turn changing code