Found the bug! Now works, adding OO as we speak