started fix for cases when natoms > 99999