refactored, added cvs option, and testing script