no logic changes.
just sorted subroutines
changed function name '_loop' -> '_main'
separated configures validate logic
separated loop logic
fixed bug: where is $r?
dubble quote -> single quote