Implemented random sphere points and direction and fixed some bugs in the code.