Simplified code
Added license
Fixed crash on concurrent track modification