Added Update Function and Clock Cycle

Also added a new variable ofr clock cycle length