implemented product function