accounting for edge cases