Updated comments and functionality