modified with some errors