Milestone: working version. Need test!