added prime quad code