Added update function, removed unused functions