added time window + minor refactoring + better placement of text + removed useless lines