Wrote parsing logic