Removed debug output, renamed function