Modified Task2 function

See #13