diff --git a/src/chapter04stacks/DynamicArrayStack.java b/src/chapter04stacks/DynamicArrayStack.java
index 2b23254..5f16b35 100644
--- a/src/chapter04stacks/DynamicArrayStack.java
+++ b/src/chapter04stacks/DynamicArrayStack.java
@@ -19,7 +19,7 @@ public class DynamicArrayStack{
 	protected int capacity;
 
 	// Default array capacity.
-	public static final int CAPACITY = 16;	// power of 2
+	public static final int CAPACITY = 1<<16;	// power of 2
 	
 	public static int MINCAPACITY=1<<15; // power of 2
 
@@ -68,12 +68,16 @@ private void expand() {
 	}
 	
 	// dynamic array operation: shrinks to 1/2 if more than than 3/4 empty
-	@SuppressWarnings("unused")
 	private void shrink() {
+		System.out.println("Inside shrink");
 		int length = top + 1;
-		if(length<=MINCAPACITY || top<<2 >= length) 
+		if(length<=MINCAPACITY || top<<2 >= length) {
+			System.out.println("top is "+top);
+			System.out.println("length is "+length);
 			return;
+		}	
 		length=length + (top<<1); // still means shrink to at 1/2 or less of the heap
+		System.out.println("length after "+length);
 		if(top<MINCAPACITY) length = MINCAPACITY;
 		int[] newStack=new int[length];
 		System.arraycopy(stackRep,0,newStack,0,top+1);
diff --git a/src/chapter04stacks/Main.java b/src/chapter04stacks/Main.java
new file mode 100644
index 0000000..4a63483
--- /dev/null
+++ b/src/chapter04stacks/Main.java
@@ -0,0 +1,26 @@
+/*Copyright (c) Jun 18, 2018 CareerMonk Publications and others.
+ * E-Mail           	: info@careermonk.com 
+ * Creation Date    	: 2015-01-10 06:15:46 
+ * Last modification	: 2006-05-31 
+               by		: Narasimha Karumanchi 
+ * File Name			: Main.java
+ * Book Title			: Data Structures And Algorithms Made In Java
+ * Warranty         	: This software is provided "as is" without any 
+ * 							warranty; without even the implied warranty of 
+ * 							merchantability or fitness for a particular purpose. 
+ * 
+ */
+
+
+package chapter04stacks;
+
+public class Main {
+	public static void main(String[] args) throws Exception {
+		DynamicArrayStack stack = new DynamicArrayStack();
+		stack.push(10);
+		stack.push(12);
+		stack.push(13);
+		stack.push(10);
+		System.out.println(stack.pop());
+	}
+}
diff --git a/src/chapter18divideandconquer/All_PeakFinder_1D_Linear_Search.java b/src/chapter18divideandconquer/All_PeakFinder_1D_Linear_Search.java
index 2c52c62..efb49e6 100644
--- a/src/chapter18divideandconquer/All_PeakFinder_1D_Linear_Search.java
+++ b/src/chapter18divideandconquer/All_PeakFinder_1D_Linear_Search.java
@@ -1,4 +1,6 @@
-public class All_PeakFinder_1D_Linear_Search{
+package chapter18divideandconquer;
+
+public class All_PeakFinder_1D_Linear_Search {
 
   public static void findPeak(int[] A) {
 
diff --git a/src/chapter18divideandconquer/Highest_PeakFinder_1D_Linear_Search.java b/src/chapter18divideandconquer/Highest_PeakFinder_1D_Linear_Search.java
index 90477e4..6d52772 100644
--- a/src/chapter18divideandconquer/Highest_PeakFinder_1D_Linear_Search.java
+++ b/src/chapter18divideandconquer/Highest_PeakFinder_1D_Linear_Search.java
@@ -1,3 +1,4 @@
+package chapter18divideandconquer;
 public class Highest_PeakFinder_1D_Linear_Search{
 
   public static Integer findPeak(int[] A) {
diff --git a/src/chapter18divideandconquer/PeakFinder_1D_Binary_Search.java b/src/chapter18divideandconquer/PeakFinder_1D_Binary_Search.java
index c39d018..cfb1f7d 100644
--- a/src/chapter18divideandconquer/PeakFinder_1D_Binary_Search.java
+++ b/src/chapter18divideandconquer/PeakFinder_1D_Binary_Search.java
@@ -1,3 +1,4 @@
+package chapter18divideandconquer;
 public class PeakFinder_1D_Binary_Search{
 
   public static Integer findPeak(int[] A) {
diff --git a/src/chapter18divideandconquer/PeakFinder_1D_Linear_Search.java b/src/chapter18divideandconquer/PeakFinder_1D_Linear_Search.java
index af56834..433e400 100644
--- a/src/chapter18divideandconquer/PeakFinder_1D_Linear_Search.java
+++ b/src/chapter18divideandconquer/PeakFinder_1D_Linear_Search.java
@@ -1,3 +1,4 @@
+package chapter18divideandconquer;
 public class PeakFinder_1D_Linear_Search{
 
   public static Integer findPeak(int[] A) {
diff --git a/src/chapter21miscconcepts/CountNumberofSetbitsin1toN.java b/src/chapter21miscconcepts/CountNumberofSetbitsin1toN.java
index 33db04d..8e152ef 100644
--- a/src/chapter21miscconcepts/CountNumberofSetbitsin1toN.java
+++ b/src/chapter21miscconcepts/CountNumberofSetbitsin1toN.java
@@ -1,17 +1,3 @@
-/*Copyright (c) Dec 22, 2014 CareerMonk Publications and others.
- * E-Mail           	: info@careermonk.com 
- * Creation Date    	: 2015-01-10 06:15:46 
- * Last modification	: 2006-05-31 
-               by		: Narasimha Karumanchi 
- * File Name			: CheckEndian.java
- * Book Title			: Data Structures And Algorithms Made In Java
- * Warranty         	: This software is provided "as is" without any 
- * 							warranty; without even the implied warranty of 
- * 							merchantability or fitness for a particular purpose. 
- * 
- */
-
-
 package chapter21miscconcepts;
 
 public class CountNumberofSetbitsin1toN {
@@ -24,6 +10,6 @@ public int countNumberofSetbitsin1toN(int n) {
 			     j = j & (j - 1); 
 			}
 		}
-		return count;		
+		return (int) count;		
 	}
 }
\ No newline at end of file
diff --git a/src/chapter21miscconcepts/RegexDemo.java b/src/chapter21miscconcepts/RegexDemo.java
index 8e6a85f..e00c4c1 100644
--- a/src/chapter21miscconcepts/RegexDemo.java
+++ b/src/chapter21miscconcepts/RegexDemo.java
@@ -1,3 +1,5 @@
+package chapter21miscconcepts;
+
 import java.util.regex.*;
 
 class RegexDemo{
