Modified to first version
Added new stuff for categories