added my changes to the latest code