added function names for clarity (saving myself from debug problems later)