Move set_model() into Loop()
Docstrings and PEP8