coding functions for assignment