some minor edits and code cleanup to how i like it