Big changes - now complete
Now works with non-primitive fields