Added compare function to bbl inorder to sort