Added bootloader and misc code