Added the margins and corrected the inputs in potential_well_generation