have some errors, but better now