added method to generate variable lenght token