add toGrey() function for converting to greyscale matrix