updated code for Chris