initial commit
changed the code to be more API like