new and delete working perfectly