working version of the buildscript