added headers and a few comments, junit tests should be done by someone soon (i am not working on them now, but gladly will if needed)