added 'proper' exceptions and some comments