Reimplemented the majority of the remaining application to use smart pointers as well