real test case
bugfix and performance enhancement