adding old code from sophomore year