added pre_run_f
added model size function