refactored view and used attr_readers throughout program