more corner cases checked and working