completed main exercise working on extra credit