finished the first part of the first problem