made function to coalesce, but doens't work yet