added a large amount of functionalilty