added templates from Andy Zhupanov. need to test who's fast