completed, passes unit tests. will try to make the last line a little prettier/functional