Close account function implemented

finished implementing close account function and its dependencies.