Initial work
working prototype in ipython worksheet