Added license header. Removed dead code