fixed a bug and doing first part of assignment