cleaned up code. getting json