it's pl not p1 (stands for `packages_list` I guess)

There's `pl = hw_packages` at the beginning of the function and `hw_packages` start with `[]`. Although the code might be a bit fragile I didn't want to change that much.