Removed debug & unused functions