Changed passing paramaters as T to const T& to prevent costly copy operations for large objects