finish basic prototype

fix bug