All functions are now working