finished assignment 3, sort of (UI is ugly, but will improve in asst 4)