finishes functionality