removed flattenings and list to binary conversions
removed unnecessary binary to list conversions