contains code for algorithmic questions