removed error handling
comments and minor adjustments