code adjusted to work support library