basic HSV grid stuff ported from previous project