Moved files to lib and fixed reverse dimensions