Count last molecule

Corrected the error where the last atom was not included hindering the
last molecule not to be counted.