finished correcting for array friendliness, no longer using matrices at all