Removed unused functions. All test cases passes locally, though I noticed sometimes some test cases times out...