Updated the buildscrtipt to be a lot more simple and efficient