some changed to make the code look nicer