Modified jojoCritical.cpp