mod function add to cal.cpp
changed