Comments added and log calls modified

Comments added and log calls modified