clean up and finish