add support for multiple exercises. refactored some code