add comments and improve variable names