updated begin fucntion