first working version
user can specify number of problems wants to solve, finally a decent working version