 				mid = (beg + end) >> 1;
 			}
 
-			return mid;
+			return Colours[mid];
 		}
 };
 

#if 1
		/* sample colours form the MF */
		const float  Mstar = sGlow.sampleMass(id);
		const float4 Cstar = Colours[sGlow.getColour(Mstar)];
		color = Cstar;

		//We need to tune this parameter, this disabled glowing stars uptill a certain time

		__device__ float sampleMass(const int id)  const
		{
			const float Mu = C*frand(id) + Mu_lo;
//			assert(Mu > 0.0);
			const float M   = __powf(Mu, slope1inv);
			return M;
		}

		__device__ float4 getColour(const float M) const
		{
			int beg = 0;
			int end = N;
