Many corner cases handled