Implemented parseWhile