Implemented grayscale conversion and working with threads