final version without testing