Bug at the end, changed function from convert to dec2bin.