updated monty hall code