Added the rest of the functionality I had before the restructure