Made chainSize dynamic

Made chainSize dynamic across devices.