Added basic view logic
Fixed error in rewriting