Added logs and unit tests for allocation