close written, to be tested