Fixes #22 - moved Accessory class to the top of file

also fixed minor syntax errors