Improved and solved some errors