implemented producer consumer problem