Checked and improved all up to timeunits (line 210)

I will continue tomorrow. I have changed some lines and added somemore
Merge pull request #1996 from osanseviero/patch-4

Checked and improved all up to timeunits (line 210)