added more robust parser, fully handles input files, and makes elevators appropriately