Removed unused functions and fixed indentation