Task 2 function

Resolves #13