Update lib.cpp

Updated file with round of bugfixes for this year's competition. Added new lib_sleep() functionality to replace removed sleep() command