added some more comments, added GPL header