added assignment 1 helper code