add many comments; consider branch prediction