Fixing so that a time-slot can be given on input as well.
Restructuring and cleaning a little

Signed-off-by: Adam Dybbroe <adam.dybbroe@smhi.se>
pep8

Signed-off-by: Adam Dybbroe <adam.dybbroe@smhi.se>