improved compile script