took care of more edge cases