Png terminal changed to pngcairo plus dashed option added and some refactoring