A framework for scalatron