defensive programming homework