Modified to output JSON