checking if item is white in function