added macro for make_pair
add prewritten code for geometry calculation