Switched over to dynamic memory allocation