corrected input parser