Add comments and slightly change for code readablity