Thanks scascio and Boran. I worked it out finally.