re-organizing code and updating readme