added rudimentary comparison function