added some cleanup to it