refactored JSON section (vastly improved), broke algorithm section