Completed

added comments and try catch block where necessary