very complicated feature tracking script