started testing

played with different error functions and updated main.