Added testing and fixed some issues in code.