#15 modified code to account for new views