functions implemented, basic test passed