Working implementation
Just want to test when it throws an Exception but otherwise implementation
works fairly well