added new functionality and improvements