Added most of base program

Ready to debug more, then extend.