getting Ricky's updated code