added some functions that will be very useful later and will make the code look cleaner