updated readme, cleaned up code, added memoization, and fixed refpaths