Changed output structure
Changed order of operation
Support for init fields
Fixed oversight of init fields implementation

magic variable "this" won't work in the script file, so they must be
used as actual init fields