updated use of pre-allocation; added homework item