Update this code to Sam's