Added solution for edge case