ppong/refactor
fixed some bugs