Performance improvement as suggested by md_5, thanks.