added a header file and reorganized code foundation