reorganized code to move library into library/