added instructions to README and generalized code for public consumption