magpie + common loop algorithms

which you should probably read in the book