Updated to process complex JSON values