updated and finished P3 (JSON still not properly functioning)