tan working with this code