Code for bluetooth and ir merged.