working code

backup working barebones code