fixed the bug but broke alot of tests.