Cleaned code, added category repeat and updated motivation example