updated, eliminated bug
More test cases added, finalize the push back rules and functions