finished all functions, need to test