Added HABTM and add unit functionality