Tests almost done, but i think ive found a bug.