add function to work with contribution data in javascript