fixing the problem with calculting ticks, adding commas for rest note