added missing breaks and returns