implemented a function to check coloring