added more implementation to parseInput()