Added function comments
removed log to prevent IE crash