added items, fixed bugs and refactored code