fixed some indentation
fixed most errors