updated mods functions and added more commenting