stringCompare tweak

Added var assign to make code more easily readable.