Revert "bad working copy, trying to debug it".
Started fresh at home, not sure what went wrong with this code!

This reverts commit d78910433bce831b2c91c03e8ddbd83825c65cb0.