Sampling routine overflow to next day bug

Signed-off-by: Oleg Komarov <o.komarov11@imperial.ac.uk>