added code for recitation 3