halfway done
bug fixes for hw4