Added code from Rich, Rupam, and Joseph