fixed some internals to make it better. Tests are failing