refactored compareVersion()
cleaned up some formatting