minimal changes in lrinitialize function