Modified to use json