Added working version of both JSON and Ruby implementation