initial commit, mostly working