added test cases for chunks detection
modified chunks detection function
updated/optimized chunks detection script