New version with testing