added normalize and viewport scaling