first commit of working version of leviathan