Added self update functionary and tests