Added function bodies

ready for submission for peer assessment