Cleaned Up code