Modified evensfirst.cpp