implemented some suggestions given by HB