main: added comment to cost function