updated for some errors slightly