Maintenance

Added bug fixes, cleaned up code, and added a few new features