Updating with good code. small bug in the clock cycles