Added some imlementation notes and made less direct use of internal variable