Contains implementation by vesa-ciandt