Adding apache license and removed some unused code.