error catching for parsing json
loljk it was actually broken and giving inaccurate results, fixed
made it ~3x more efficient, cleaned things up, comments