created separate functions for min-max, calculate difference in bits and relationships