Code almost completed, finishing pending.

Signed-off-by: Sanjay Madnani <http://sanjaymadnani.wordpress.com/>