First properly-working version of builder script