fixed stain guard math bug