minor edits to prettify the code