created sam.cpp