First implementation of the basemask generator