Functions work, commented and ready for peer assessment