finish of HW4,but it use bad method without NSDictionary