modified to suit my needs.