Made cosmetic changes to get ready for demo
+ added more null checking