Changed for loops/list comps to map funcs.