Added leave command, commented code, general tidying.