cleaned, added more comments