first commit, still needs debugging and docs.