first shot at some fancy matrix math