added package handling test code to main