Another example and now added functions for vector or png output