attempted some functional methods for speed improvement... subtle difference