some touches on #6

Added som more logic. Committing to keep code up to date on all sites I
do developement.