Updated input and main to new spec. Need to investigate use of _hooks for #macro usage.