First functional implementation of the parse method