fixed bug where nil fields threw error
Added debug statement and ordering of list