Beginning vectorised code.