Worked version, without tests