partial #7 + fix bug