clean up and final compile