diff --git a/css/bulma-adjustments.css b/css/bulma-adjustments.css
index 07e5e77..ff91e36 100644
--- a/css/bulma-adjustments.css
+++ b/css/bulma-adjustments.css
@@ -22,6 +22,36 @@
 .buttons.grid .complex-button {
     flex: 1 0 34%;
     margin: 15px 10px;
+    min-width: min(100%, 300px);
+}
+
+.buttons.grid .complex-button.is-selected .message-header {
+    background-color: #3273dc;
+    color: #fff;
+}
+
+.buttons.grid .complex-button.is-selected .message-body.is-selected {
+    background-color: #eef3fc;
+    color: #2160c4;
+}
+
+.rooms-container {
+    display: flex;
+    flex-direction: row;
+}
+
+.rooms-container .message-body {
+    border-width: 0;
+    border-top-left-radius: 0;
+    border-top-right-radius: 0;
+    flex-grow: 1;
+
+    cursor: pointer;
+}
+
+.rooms-container .message-body:not(:last-child) {
+    border-bottom-right-radius: 0;
+    border-right: solid 1px #4a4a4a;
 }
 
 .section {
diff --git a/index.html b/index.html
index 0e65137..7d822a7 100644
--- a/index.html
+++ b/index.html
@@ -3,17 +3,16 @@
 <html lang="ca">
     <head>
         <meta charset="UTF-8">
-		<title>Seients DAFME</title>
+        <title>Seients DAFME</title>
 
-		<meta name="viewport" content="width=device-width, initial-scale=1">
-		<link rel="manifest" href="manifest.json">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="manifest" href="manifest.json">
 
-		<!-- Apple web app -->
-		<link rel="apple-touch-icon" href="./images/icon-64.png">
-		<meta name="apple-mobile-web-app-title" content="Seients DAFME">
-		<meta name="apple-mobile-web-app-capable" content="yes">
-		<meta name="apple-mobile-web-app-status-bar-style" content="white">
-        
+        <!-- Apple web app -->
+        <link rel="apple-touch-icon" href="./images/icon-64.png">
+        <meta name="apple-mobile-web-app-title" content="Seients DAFME">
+        <meta name="apple-mobile-web-app-capable" content="yes">
+        <meta name="apple-mobile-web-app-status-bar-style" content="white">
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
         <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css">
         <link rel="stylesheet" href="./css/bulma-adjustments.css">
@@ -84,14 +83,6 @@
         <section id="section-2" class="section is-hidden">
             <button class="button is-link is-light" onclick="switchSection('section-1')">Torna enrere (Classe)</button>
 
-            <div id="repeated-subject-warning" class="is-hidden">
-                <br><article class="message is-warning">
-                    <div class="message-body">
-                        Heu triat una assignatura que es fa en dues aules alhora. Comproveu que sou a l'aula <strong id="repeated-subject-warning-class">aula</strong>.
-                    </div>
-                </article>
-            </div> -->
-
             <div id="letter-container" class="buttons grid">
                 <button class="button" id="letter-A" data-letter="A">A</button>
                 <button class="button" id="letter-B" data-letter="B">B</button>
@@ -127,6 +118,13 @@
         <section id="section-send" class="section is-hidden">
             <button class="button is-link is-light" onclick="switchSection('section-3')">Torna enrere (Número)</button>
             <br/><br/>
+	    <div id="repeated-subject-warning" class="is-hidden">
+                <br><article class="message is-warning">
+                    <div class="message-body">
+                        Heu triat una assignatura que es fa en dues aules alhora. Comproveu que sou a l'aula <strong id="repeated-subject-warning-class">aula</strong>.
+                    </div>
+                </article>
+            </div>
             <span class="has-text-weight-bold">Assignatura:</span>
             <span id="subject-final">ASSIGNATURA ESCOLLIDA</span><br>
             <span class="has-text-weight-bold">Aula:</span>
diff --git a/js/build_page.js b/js/build_page.js
index 1e4df98..aedfbdb 100644
--- a/js/build_page.js
+++ b/js/build_page.js
@@ -43,7 +43,7 @@
 
     document.getElementById('subject-final').textContent = final_JSON.class.friendly_name || final_JSON.class.calendar_name;
     document.getElementById('classroom-final').textContent = final_JSON.class.room;
-    document.getElementById('date-final').textContent = begins.toLocaleDateString();
+    document.getElementById('date-final').textContent = formatDate(begins);
     document.getElementById('time-final').textContent = formatTime(begins) + ' - ' + formatTime(ends);
     document.getElementById('letter-final').textContent = final_JSON.letter;
     document.getElementById('number-final').textContent = final_JSON.number;
@@ -56,17 +56,11 @@
     if (parent == "subject-container") {
         // Canvi de background del button
         var selectedClass = JSON.parse(btn.getAttribute('data-class'));
-        $("#subject-container .complex-button").removeClass("is-link")
-        btn.classList.add("is-link");
+        $("#subject-container .complex-button, #subject-container .message-body").removeClass("is-selected")
+        btn.classList.add('is-selected');
+        btn.parentNode.parentNode.classList.add('is-selected');
         // Canvi JSON
         final_JSON["class"] = selectedClass;
-        // Missatge advertència classe repetida
-        if (repeated_subjects.has(selectedClass.id)) {
-            document.getElementById('repeated-subject-warning').classList.remove('is-hidden');
-            document.getElementById('repeated-subject-warning-class').textContent = selectedClass.room;
-        } else {
-            document.getElementById('repeated-subject-warning').classList.add('is-hidden');
-        }
         // Anchor següent pregunta
         switchSection("section-2");
     } else if (parent == "number-container") {
@@ -109,80 +103,80 @@
     return rep;
 }
 
-function buildSubjectContainer(classes, repeated) {
-    var duplicateSubjectBoolNext, duplicateSubjectBoolPrev;
-    var duplicateSubjectCounter = 0;
-    
-    for (var [i, classe] of classes) {        
-        var hora_inici = formatDate(new Date(parseInt(classe.begins)*1000));
-        var hora_final = formatDate(new Date(parseInt(classe.ends)*1000));
+function transformClasses(rawClasses) {
+    var classes = [];
+    rawClasses.forEach(c => {
+        var found = false;
+        for (var i = 0; i < classes.length; ++i) {
+            if ((classes[i][0].friendly_name || classes[i][0].calendar_name) == (c.friendly_name || c.calendar_name)) {
+                classes[i].push(c);
+                found = true;
+                break;
+            }
+        }
+
+        if (!found) {
+            classes.push([c]);
+        }
+    });
+
+    return classes;
+}
+
+function buildSubjectContainer(classes) {
+    // Flush existing classes
+    document.querySelectorAll('#subject-container .message').forEach(function(classe) {
+        classe.parentNode.removeChild(classe);
+    });
+
+    for (var uniqueClasses of classes) {
+        var firstClass = uniqueClasses[0];
+        var hora_inici = formatTime(new Date(parseInt(firstClass.begins)*1000));
+        var hora_final = formatTime(new Date(parseInt(firstClass.ends)*1000));
+
         var classeDiv = document.createElement('div');
-        
-        // Check if the subject is repeated
-        duplicateSubjectBoolNext = data.payload.classes[i+1].friendly_name == classe.friendly_name;
-        duplicateSubjectBoolPrev = data.payload.classes[i-1].friendly_name == classe.friendly_name;
-        
-        if(duplicateSubjectBoolNext && i < classes.length - 1 && duplicateSubjectCounter%2 == 1) {
-            classeDiv.classList.add('message', 'complex-button-full');
-        }
-        
-        if (duplicateSubjectBoolPrev && i > 0) {
-            classeDiv.classList.add('message', 'complex-button2Right');
-        } else if(duplicateSubjectBoolNext && i < data.payload.classes.length - 1) {
-            classeDiv.classList.add('message', 'complex-button2Left');
-        } else {
-            classeDiv.classList.add('message', 'complex-button');
-        }
-        
         classeDiv.classList.add('message', 'complex-button');
-        classeDiv.id = 'subject-' + classe.subject_id + '-' + classe.room;
-        classeDiv.setAttribute('data-class', JSON.stringify(classe));
 
         var header = document.createElement('div');
         header.classList.add('message-header');
+        header.textContent = firstClass.friendly_name || firstClass.calendar_name;
 
-        if (!(duplicateSubjectBoolPrev && i > 0)) {
-            header.textContent = classe.friendly_name || classe.calendar_name;
-        } else {
-            header.textContent = classe.friendly_name || classe.calendar_name;;
-            header.style.color = "#4A4A4A";
-        }
-        
-        var body = document.createElement('div');
-        body.classList.add('message-body');
-
-        var div1 = document.createElement('div');
-        var span = document.createElement('span');
-        span.textContent = classe.room;
-
-        div1.classList.add('has-text-weight-bold');
-
-        div1.textContent = 'Aula ';
-        div1.appendChild(span);
-
-        var div2 = document.createElement('div');
-        div2.textContent = hora_inici + ' - ' + hora_final;
-
-        body.appendChild(div1);
-        body.appendChild(div2);
+        var roomsDiv = document.createElement('div');
+        roomsDiv.classList.add('rooms-container');
 
         classeDiv.appendChild(header);
-        classeDiv.appendChild(body);
 
+        for (var classe of uniqueClasses) {
+            if (classe.user_selected) {
+                classeDiv.classList.add('is-primary');
+            }
+
+            var body = document.createElement('div');
+            body.classList.add('message-body');
+            body.setAttribute('data-class', JSON.stringify(classe));
+            body.addEventListener('click', clickButton);
+            body.parent = 'subject-container';
+
+            var div1 = document.createElement('div');
+
+            div1.classList.add('has-text-weight-bold');
+            div1.textContent = 'Aula ';
+
+            var span = document.createElement('span');
+            span.textContent = classe.room;
+            div1.appendChild(span);
+
+            var div2 = document.createElement('div');
+            div2.textContent = hora_inici + ' - ' + hora_final;
+
+            body.appendChild(div1);
+            body.appendChild(div2);
+            roomsDiv.appendChild(body);
+        }
+
+        classeDiv.appendChild(roomsDiv);
         document.getElementById("subject-container").appendChild(classeDiv);
-        ++duplicateSubjectCounter;
     }
-  
-    var elements = document.getElementsByClassName("button");
-    Array.from(elements).forEach(function(element) {
-        element.addEventListener('click', clickButton);
-        element.parent = element.parentNode.id;
-    });
-    var elements = document.getElementsByClassName("complex-button");
-    Array.from(elements).forEach(function(element) {
-        element.addEventListener('click', clickButton);
-        element.parent = element.parentNode.id;
-    });
 }
 
 function getDefaultTime() {
@@ -208,6 +202,13 @@
     document.getElementById("time-selector").value = formatTime(date) + " - " + formatTime(end_time);
 }
 
+function isDateAfterTomorrow(potential_time) {
+  var now = new Date();
+  var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
+
+  return (potential_time >= tomorrow);
+}
+
 function addDateEventListeners(date) {
     document.getElementById("date-prev").addEventListener('click', function (el) {
         current_time = new Date(current_time.getTime() - 24*60*60000);
@@ -215,7 +216,11 @@
         fetchClasses();
     });
     document.getElementById("date-next").addEventListener('click', function (el) {
-        current_time = new Date(current_time.getTime() + 24*60*60000);
+        var potential_time = new Date(current_time.getTime() + 24*60*60000);
+
+        if (isDateAfterTomorrow(potential_time)) return;
+        current_time = potential_time;
+
         buildTimeSelector(current_time);
         fetchClasses();
     });
@@ -230,12 +235,16 @@
         fetchClasses();
     });
     document.getElementById("time-next").addEventListener('click', function (el) {
-        current_time = new Date(current_time.getTime() + 30*60000);
-        if (current_time.getHours() >= MAX_HOUR) {
-            current_time = new Date(current_time.getTime() + 24*60*60000);
-            current_time.setHours(MIN_HOUR);
-            current_time.setMinutes(0);
+        var potential_time = new Date(current_time.getTime() + 30*60000);
+        if (potential_time.getHours() >= MAX_HOUR) {
+            potential_time = new Date(potential_time.getTime() + 24*60*60000);
+            potential_time.setHours(MIN_HOUR);
+            potential_time.setMinutes(0);
         }
+
+        if (isDateAfterTomorrow(potential_time)) return;
+        current_time = potential_time;
+
         buildTimeSelector(current_time);
         fetchClasses();
     });
@@ -256,7 +265,6 @@
 }
 
 function fetchClasses() {
-    console.log(api_url + "getClassesInTime/" + current_time.getTime()/1000);
     fetch(api_url + "getClassesInTime/" + current_time.getTime()/1000, {
         "mode": "cors",
         "credentials": "include"
@@ -268,8 +276,8 @@
                 document.getElementById('subject-container').classList.add('is-hidden');
                 document.getElementById('fme-maps-container').classList.add('is-hidden');
             } else {
-                repeated_subjects = findRepeatedSubjects(data.payload.classes);
-                buildSubjectContainer(data.payload.classes, repeated_subjects);
+                var transformedClasses = transformClasses(data.payload.classes);
+                buildSubjectContainer(transformedClasses);
                 document.getElementById('no-subjects').classList.add('is-hidden');
                 document.getElementById('subject-container').classList.remove('is-hidden');
                 document.getElementById('fme-maps-container').classList.remove('is-hidden');
