Updated parser - with preliminary error handling