refactored the way fields are ordered. added docs