The comments and variable names were partly misleading. I grouped all members, hopefully gave them more understandable names and adjusted the comments.