update to complete most of the source code