write results method fixed