added scaling for buffImg and removed redundant code
added some macro for changing the visualization settings