Updated to work as a standalone package