initial version done, still have bugs