rename main to calculate_closure so that its more intuitive