close #2
fixes and optim