switched to c, implemented turning