build system rewritten