improved testing and functionality