Major improvements to sample app