fixed some flaws I had in intervals