made it interval based
took out commented code