added support for lib directory, fixed bugs, and support for grapes