code refactoring. added translation and beginnings of scaling functions.