#2 datamodel and lots of small isolated bugs fixed