Initial upload

To fix: get index out-of-bound errors, possibly indexing functions.