Fix with random generation and voltage calculation is done