Added testing and other functions