Added comments and some cleanup to test