Added floating items, reorganized code