added mathML generation
fixed a type bug in short searches, but still gives wrong answer for things like P=~~P