version with saving to png