Completed execution code, have NOT tested.