Add function grid in common.cpp/h