formatted
updated comments and formatting
updated getRandom
updated ATTRIB_PATTERN
updated formatting