a little bit more logic