Moved Hitmap logic around