first commit, restructuring code