Modified to use JSON and upgrade to latest version