Updated code to use JSON files