Accidentally deleted some important functions, fixed