Merge some codes from my tracks