functions transferred to helpingFunctions.cpp