Implements first version of  #1152