Change logic for button positive edge detection

On random number generator