diff --git a/dwm b/dwm
new file mode 100755
index 0000000..cb418ce
Binary files /dev/null and b/dwm differ
diff --git a/dwm.c b/dwm.c
index f1d86b2..4b0ab2c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -163,6 +163,7 @@ static void detachstack(Client *c);
 static Monitor *dirtomon(int dir);
 static void drawbar(Monitor *m);
 static void drawbars(void);
+static void drawpreviews(Monitor *m, unsigned int w);
 static void enternotify(XEvent *e);
 static void expose(XEvent *e);
 static void focus(Client *c);
@@ -434,7 +435,7 @@ buttonpress(XEvent *e)
 	if (ev->window == selmon->barwin) {
 		i = x = 0;
 		do
-			x += TEXTW(tags[i]);
+			x += m->mw / (m->mh / bh);
 		while (ev->x >= x && ++i < LENGTH(tags));
 		if (i < LENGTH(tags)) {
 			click = ClkTagBar;
@@ -698,11 +699,11 @@ dirtomon(int dir)
 void
 drawbar(Monitor *m)
 {
-	int x, w, tw = 0;
+	int x, tw = 0;
+	int w = m->mw / (m->mh / bh);
 	int boxs = drw->fonts->h / 9;
 	int boxw = drw->fonts->h / 6 + 2;
-	unsigned int i, occ = 0, urg = 0;
-	Client *c;
+	unsigned int i;
 
 	if (!m->showbar)
 		return;
@@ -714,22 +715,15 @@ drawbar(Monitor *m)
 		drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
 	}
 
-	for (c = m->clients; c; c = c->next) {
-		occ |= c->tags;
-		if (c->isurgent)
-			urg |= c->tags;
-	}
 	x = 0;
 	for (i = 0; i < LENGTH(tags); i++) {
-		w = TEXTW(tags[i]);
 		drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
-		drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
-		if (occ & 1 << i)
-			drw_rect(drw, x + boxs, boxs, boxw, boxw,
-				m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
-				urg & 1 << i);
+		drw_text(drw, x, 0, w, bh, 0, "", 0);
 		x += w;
 	}
+
+	drawpreviews(m, w);
+
 	w = TEXTW(m->ltsymbol);
 	drw_setscheme(drw, scheme[SchemeNorm]);
 	x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
@@ -748,6 +742,96 @@ drawbar(Monitor *m)
 	drw_map(drw, m->barwin, 0, 0, m->ww, bh);
 }
 
+void
+drawpreviews(Monitor *m, unsigned int w)
+{
+	int pad = 2;
+	int pw = w - pad*2;
+	int ph = bh - pad*2;
+	unsigned int j, n, i, x, h, mw, my, ty;
+	int cx, cy, cw, ch;
+	int selx, sely, selw, selh;
+	Client* c;
+
+
+	for (selx = sely = selw = selh = j = 0; j < LENGTH(tags); j++) {
+		for (n = 0, c = m->clients; c; c = c->next) {
+			if (!(c->tags & (1<<j)) || c->isfloating)
+				continue;
+			n++;
+		}
+
+		if (n > m->nmaster)
+			mw = m->nmaster ? pw * m->mfact : 0;
+		else
+			mw = pw;
+
+		drw_setscheme(drw, scheme[SchemeNorm]);
+		for (i = 0, my = ty = pad, c = m->clients; c; c = c->next) {
+			if (!(c->tags & (1<<j)))
+				continue;
+			x = (w * j) + pad;
+			if (c->isfloating) {
+				cx = c->x / (m->mw / pw);
+				cy = c->y / (m->mh / ph);
+				cw = MAX(2, WIDTH(c) / (m->mw / pw));
+				ch = MAX(2, HEIGHT(c) / (m->mh / ph));
+
+				if (cx < 0) {
+					cw = MAX(cw + cx, 2);
+					cx = 0;
+				}
+				if (cy < 0) {
+					ch = MAX(ch + cy, 2);
+					cy = 0;
+				}
+
+				if (cx >= pw)
+					 cx = pw - 2;
+				if (cy >= ph)
+					cy = ph - 2;
+
+				if (cx + cw > pw)
+					cw = pw - cx;
+
+				if (cy + ch > ph)
+					ch = ph - cy;
+
+				if (c == m->sel)
+					selx = x + cx, sely = pad + cy, selw = cw, selh = ch;
+				else
+					drw_rect(drw, x + cx, pad + cy, cw, ch, 0, c->isurgent);
+			}
+			else if (i < m->nmaster) {
+				h = (ph + (MIN(n, m->nmaster) - i) - my) / (MIN(n, m->nmaster) - i);
+				if (my + h - 1 > ph)
+					h = ph - my;
+				if (c == m->sel)
+					selx = x, sely = my, selw = mw, selh = h;
+				else
+					drw_rect(drw, x, my, mw, h, 0, c->isurgent);
+				my += h - 1;
+				i++;
+			} else {
+				h = (ph + (n - i) - ty) / (n - i);
+				if (ty + h - 1 > ph)
+					h = ph - ty;
+				if (c == m->sel)
+					selx = x + mw - 1, sely = ty, selw = pw - (mw - 1), selh = h;
+					else
+						drw_rect(drw, x + mw - 1, ty, pw - (mw - 1), h, 0, c->isurgent);
+				ty += h - 1;
+				i++;
+			}
+		}
+
+		if (selx | sely | selw | selh) {
+			drw_setscheme(drw, scheme[SchemeSel]);
+			drw_rect(drw, selx, sely, selw, selh, 0, 0);
+		}
+	}
+}
+
 void
 drawbars(void)
 {
@@ -1189,8 +1273,10 @@ movemouse(const Arg *arg)
 			if (!c->isfloating && selmon->lt[selmon->sellt]->arrange
 			&& (abs(nx - c->x) > snap || abs(ny - c->y) > snap))
 				togglefloating(NULL);
-			if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
+			if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) {
 				resize(c, nx, ny, c->w, c->h, 1);
+                drawbars();
+            }
 			break;
 		}
 	} while (ev.type != ButtonRelease);
@@ -1339,8 +1425,10 @@ resizemouse(const Arg *arg)
 				&& (abs(nw - c->w) > snap || abs(nh - c->h) > snap))
 					togglefloating(NULL);
 			}
-			if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
+			if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) {
 				resize(c, c->x, c->y, nw, nh, 1);
+			    drawbars();
+            }
 			break;
 		}
 	} while (ev.type != ButtonRelease);
