Constructor uses associative array and added toString function