update the trackLayout function