Initial commit with function modelled on example