Tweaked condition for intersection between ray and planes being on the cube. Also changed som variable names to make it more purty. =)