Code rearrangement

testing half the code to see if we can remove the delay