added new function to main