Added track class, fixed bugs