formatted and removed dead code, basic tests added
formatted and removed dead code, basic tests added