Create lib.cpp

file with implementation functions