Date Mining code