some more code, comments, package restructuring. still no tests