Updating to Vincent's current code