Cleaned up the decision function and added test