Major changes + fixing the tests