First draft: mainly functional, but lot of things to be clean/improved