cleaned up problem logic