doggy and ball pseudocoded: now to just actually implement things