cleaned up file and created functions for demo