function convertToBinary(num) {
let num2 = num.toString(2);
while(num2.length<8) {
num2 = '0' + num2;
}
return num2;