function to add assignments