Implemented scales.

Fixes #146.