implemented model loading