Problems 1-4 complete with tests