First implementation of #1