cmp function for loading first few times