some excising code for leetcode