Added update function and made the other functions accepting of more data