fixed some blood trail issues
optimised the square root function slightly