refactors unnessasary code
adds a new test which mostly passes, updates other tests