Moved functions from laxwrappers to main lacosmicx file to make compilation easier.