Code written. Stuck in infinite loop.