Adapted comments to timotimo++'s suggestion