fixed code attempt 2