Organized and the functions actually work now