     }
   }
 
-  T calcError( vector<T> &targets )
+  T calcError( Vector<T> &targets )
   {
     T netErr = (T)0.0, delta;
     // minus bias


  T sumIn;

  String _name;

  Layer( int n, int act, bool bias )
: 
    count(n), prevLayer(NULL), nextLayer(NULL), _activation(act), _bias(bias),
    sumIn(0.0)

enum ActType{ 
  linear = 0, sigmoid, tangenth, none, bias };


template <class T>
class funcs
{
  public:
  static T actBias( T n )
  {
    return 1.0;
  }

  static T actNone( T n )
  {
    return n;
  }

  static T actLinear( T n )
  {
    return n;
  }

  static T actSigmoid( T n )
  {
    return 1.0 / ( 1.0 + exp(-n) );
  }
    
  static T derivLinear( T n )
  {
    return 1.0;
  }
  
  static T derivSigmoid( T n )
  {
    return n * ( 1.0 - n );
  }
};


// Minimal class to replace std::vector
template<class Data>
class Vector {
  size_t d_size; // Stores no. of actually stored objects
  size_t d_capacity; // Stores allocated capacity
  Data *d_data; // Stores data
public:
  Vector() : 
  d_size(0), d_capacity(0), d_data(0) {
  }; // Default constructor
  Vector(Vector const &other) : 
  d_size(other.d_size), d_capacity(other.d_capacity), d_data(0) { 
    d_data = (Data *)malloc(d_capacity*sizeof(Data)); 
    memcpy(d_data, other.d_data, d_size*sizeof(Data)); 
  }; // Copy constuctor
  ~Vector() { 
    free(d_data); 
  }; // Destructor
  Vector &operator=(Vector const &other) { 
    free(d_data); 
    d_size = other.d_size; 
    d_capacity = other.d_capacity; 
    d_data = (Data *)malloc(d_capacity*sizeof(Data)); 
    memcpy(d_data, other.d_data, d_size*sizeof(Data)); 
    return *this; 
  }; // Needed for memory management
  void push_back(Data const &x) { 
    if (d_capacity == d_size) resize(); 
    d_data[d_size++] = x; 
  }; // Adds new value. If needed, allocates more space
  size_t size() const { 
    return d_size; 
  }; // Size getter
  Data const &operator[](size_t idx) const { 
    return d_data[idx]; 
  }; // Const getter
  Data &operator[](size_t idx) { 
    return d_data[idx]; 
  }; // Changeable getter
private:
  void resize() { 
    d_capacity = d_capacity ? d_capacity*2 : 1; 
    Data *newdata = (Data *)malloc(d_capacity*sizeof(Data)); 
    memcpy(newdata, d_data, d_size * sizeof(Data)); 
    free(d_data); 
    d_data = newdata; 
  };// Allocates double the old space
};



template<typename T>
class Node
