add head/tail function and edit header in dcdedit.py