functions for coursera