Added delegate, and modified to work as a standalone view.