source simplified opitimized, added batch file generation