issue #2 and code restyling