Temporary commit:
new method seems good, however TODO: length cap should increase adaptively