added comments and testing, displaying in views