Removing some functions and fixing