Added a lot more framework and some of the functionality