ugly hacky way, but recusion is actually correct now