almost final code

Change-Id: I0770330723412717a2cebbcc35dfbe8eea2023fb