Fix the timing and add some specs
Still terrible code...