casts added
binary searches added