changed interval feature so that it will work with 2 arguements