Updated comments, renamed temp variables.