messed around with json encode