Added and Tested Comparison Function