function delete done and refactory some scanf functions