began writing general functions