Added A test file and fixed a bug