lib functions added, wip