bug fixes; spruce up code; new __init__