Added memory and time measurements to the programs