Before using trails code