Using constant memory to speed things up a bit