functions added

split into .h and .cpp file (it bugged me)