updated interval algo
added a docco output