Shamelessly steal code and rewrite it