add function and write notes