lab01: code reorganization