fixing mapToInterval

mod works differently in javascript than in python…