massive update to fix #20 and other small stuff