Removing memory leaks

Removing memoryleaks by rewriting the map strukture
Removing unnessesary include