Added hpp, cpp files for common functions,
some work on everything else