add exception handling and better output