Item is a record; just made the code compile; needs much more refactoring