initial commit, most of the implementation done