Working parse function

@harrison can you review please?