initial compile_model function