added comments and stubbed exeception handling