Figured out this madness
a few minor changes