Swapped  and  fields, removed  from a() and added lots of documentation.