fix
moved error detection to proper place
added roundup() to utils
implemented proper tik content idx generation
fixed ptr misalignment