initial commit, ugly but functional, no tests yet