almost finish part of assignment3