Filled in functions with comments