hw1 for object orientated programming