pushing jc's code for compare