Much thinking needed in the backend part. Hacking! left in unfinished state