Changed wo find algorithm