Fix the 'down' scaling method to actually scale down; refactor scaling function into separate module.