fixed most errors