cleaned Up code