modified and cleared up comments