added build script + added missing terminal size function