added funding criteria function
added write to csv function
attempt to deal with quirky json input