finally a working prime program