Refine output and add scale calculation