Modified for my needs.