minor edits on code