added function for building visualization