added domain scaling algoithm