Add more comments and remove unused session_set variable