final version but still have bugs