removed some dependency on chk_size