Moved every indentation to 4 spaces, added dependency check, updated replace-nth and sort