Flow modified, Test cases added

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