Initialize the variables d5 and d6 once they are needed, not earlier