This logic and approach is very cool.