changed contains function so it works