accounting for edge cases.