edited modules and code cleanup