code from 2013 UCLA Inventathon