Organization of code

added new files to organize and eliminate reuse of code, still needs
work