updated test cases
fixed bug that generate wrong prefixes