made tests pass (needs te be revised though)