Oh yes that gives me some ideas for things to learn - dynamic memory allocation and overloading functions. If you're using C++ you can use function templates too.