Minor changes : Replaced throws clauses with try-catch blocks.