attempt at dynamic memory