Further work on functions chapter, set up for environments chapter