Working HW3, not polished, but submited