First implementation, bugfixing phase.