Adding in binary packing algorithm