Added some tests

And Formatted code