Added test
Reformated code