additional comments and removed unnecessary vars