rm not used code
modify session algorithm