added a version with shrinking

Signed-off-by: Marcin Wiatr <mail.wichura@gmail.com>