Fixed allocation functions; started on more