added update callback; cleaned up source