minor output bug corrected