Updated debugging and put a delay in