commented, semi tested