added prenexing code