modified gtools.cpp