removes dead code
removes dead code
tabs to spaces
removes debug messages
removes old log function
removes unused flag