Added comment concerning performance
Improved exception handling