updated from final submission for hw