Commented and updated code format/style