preparepackage() and endpackage() v1 completed