Really nice code with the use of pointers... and also memory management...