changed structure and functionality