cleanup code
reformat source code
use MSG_NUM prototype whenever possible