This is kind of cool.

Also looks like a lot of duplication :)