added some module files; cleaned up some existing code