preliminarily complete the code