Cleaned up prototype so I can merge back into master.