Refactor (merged pairTwo function)
Nicer write function
Fixed bug where expressions were compared directly rather than comparing their evaluated values
Formatting