Added UpdateWindow function
Source cleanup and removal of commented params