restructured the code following some style guidelines