Modified code for hit to use floating randoms