Finished first rewrite into procedures as objects.