functions needed for favorites

If you see anything that needs to be changed feel free to change it.