Fixed bugs within my shadow ray collision detection and my distance formula function