added lot of extra functionality.