Third homework - brief and neat

Added a new method and removed two blocks of repetitive code