Revamped code to be faster

serial design demuxed by half