second attempt, partially complete