Fixed Logic Problem