Added categories, fixed more code