first take on struct to map function