fixed code attempt 1