This could probably be better, but I don't really care because that one was tough. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>