Main functionality now works, but only once.