added documentations and checkAccountEmpty function