some repairs and changes by BK