vinay - very ugly code but works..no one look