final working implementation for cttz

Its handling two cases and test case works now. making it work for
all bit patterns now.