function convertToBinary(num) {
    return '0'.repeat(8-num.toString(2).length)+num.toString(2);
}