rearrange some source; fix arg counts.
prepare v0.6