cleanup of unused function; documentation and fixing of messages