scala style changes to example