restructure, fix output index bug
allow keywords