changed the code for prenexing