Works again, but ugly implementation.