implement basics and problem 1-6