the function returns undefined, so I made it return an object instead.