Some refactoring and a few adjustments to my in and out on both sides. NOT DONE