This is the function for the Coursera project