Updated the method stubs with working code. The methods now work correctly. Test cases are in the same file
Added comments to the methods. Corrected formatting. Removed the testing code.