refactor
Code reordered, works!
ignore me
removed some stupid use of dereferencing