added ordering
fixed parser