I'm not exactly enthusiastic about this code, but it's a Friday at 5pm. If you have better alternatives, please comment.