Created function to check for draw condition