adding csv output and beautifying output