started rewrite of /cup with new sqlite method