updated turn code