Adding comments + improvements to unit test + cleanup