Finished all functions, added new tests