Finally, a version I'm proud of. :)