added some functions to make scaling with AWT and dumping data faster