Fix position calculation; change resize calculation (fix #3); add another example