refactored JSON. now faster and ordered output. added output Action method