implemented model selecting
implemented resetting selected model when entering build mode, refactored some code