Created main tracker function