Tested version

Did some wrong calculations in the first version. This version has had
one succesful testrun. It also should take the DST in account (not
tested)