removed clog2 function and replaced it with systemcall