curious behaviour, maybe just maybe getting my head around JS functions