this closes #20 also better organization.