some code for interesting algorithms questions