initial bug fix, the structure is not passing all tests yet :(