fixed all bugs in input parser