First implementation, untested