added implementation detailed comments