first part with rate, update & database works