defined 2 necessary functions