Added some stuff to ray to do some measurements
added parallel to ray calculations