added getPackages function