fix the assignment error and formatting