Added Tests and fixed up formatting accordingly