Good start on the commenting, but it needs to be easier to understand what all the ifs are checking in physical terms.