Added min / max checking