preliminary image moment code