added licence..
Todo: use smart pointers