The first version submitted as my C++.NET end-term homework ^_^