SetInterval: add dist function