Added logic to handle the three types of turn actions