beginning of firmware. untested