Added plot and legent to 3rd task
Merged solutions, refactored, added comments