Cleaned code, updated test data, added functions