moved lib implementation
added lib implementation

'lib' version of functions are run before the 'script' version.... kind
of confusing right now with how I'm referring to it... but it will
become more clear in time