updated build script and main.m