Add prime checker function